import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopDispatchSelfetchController } from '../../../controllers';
const uctoominishopDispatchSelfetchRouter = new Router();
const minishopDispatchSelfetchController = new uctooMinishopDispatchSelfetchController();

uctoominishopDispatchSelfetchRouter.post('/add', requireUser, minishopDispatchSelfetchController.add);
uctoominishopDispatchSelfetchRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_dispatch_selfetch'), minishopDispatchSelfetchController.edit);
uctoominishopDispatchSelfetchRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_dispatch_selfetch'), minishopDispatchSelfetchController.delete);

//For getting minishopDispatchSelfetch with permission control
uctoominishopDispatchSelfetchRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_selfetch'), minishopDispatchSelfetchController.getSingle);
uctoominishopDispatchSelfetchRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_selfetch'), minishopDispatchSelfetchController.getMany);
uctoominishopDispatchSelfetchRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_selfetch'), minishopDispatchSelfetchController.getMany);

//#endregion AutoCreateCode
export default uctoominishopDispatchSelfetchRouter;
